<template>
  <u-drawer
    v-model:visible="selfVisible"
    title="查看短信任务模板"
    :width="520"
    @after-visible-change="handleChange"
  >
    <view-content :data="currentModel" :setting="settings" :column="1" />
  </u-drawer>
</template>
<script>
import { ViewContent } from '@bairong/vix'
import useDrawer from '@/hooks/useDrawer'

export default {
  name: 'MessageView',
  components: { ViewContent },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    currentModel: {
      type: [Object],
      default: () => ({})
    }
  },
  setup(props, { emit }) {
    const { selfVisible, handleChange } = useDrawer(props, emit)

    const settings = [
      {
        name: 'templateName',
        label: '短信任务名称'
      },
      {
        name: 'companyName',
        label: '商户'
      },
      {
        name: 'smsTemplateName',
        label: '短信模板'
      },
      {
        name: 'number',
        label: '短信链接编号'
      },
      {
        name: 'shortLink',
        label: '短信链接'
      },
      {
        name: 'remark',
        label: '备注'
      }
    ]

    return {
      selfVisible,
      settings,
      handleChange
    }
  }
}
</script>
<style lang="less">

</style>
